package cn.catsdad.dto;

import cn.catsdad.entity.Menu;
import cn.catsdad.vo.TreeNodeVO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 菜单dto
 *
 * @author xuyonglong
 * @version V1.0 2023/4/12
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "tb_auth_menu")
public class MenuDTO extends Menu {

    /**
     * 床架树形节点
     *
     * @return 树形节点
     */
    public TreeNodeVO initTreeNode() {
        return new TreeNodeVO()
                .setId(getId())
                .setLabel(getName())
                .setParentId(getParentId())
                .setExtraValue1(getStatus().toString())
                .setOrderNum(getOrderNum())
                .setExtraValue2(getIcon());
    }

}
